<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="publico/template/templateSemMenu.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui">

    <ui:define name="content">
        <p:growl/>
        <form 
            action="#{request.contextPath}/j_spring_security_check" 
            method="post">
            <h:panelGroup rendered="#{!empty param.login_error}">
                <span style="color: red">  * Erro ao efetuar o login</span>
                <br/>
            </h:panelGroup>

            <div align="center">

                <p:panel id="panelLogin">
                    <h:outputText id="bemVindo" value="Bem vindo(a) ao Invio."/>
                    <br/>
                    <br/>
                    <h:panelGrid  id="gridLogin"  style="width: 32%" columns="2">

                        <h:outputText id="loginLabel" value="E-mail:"/>
                        <p:inputText required="true" id="j_username"/>

                        <h:outputText value="Senha: " />  
                        <p:password 
                            required="true"
                            id="j_password" /> 


                    </h:panelGrid>

                    <p:panel style ="border-color: transparent; 
                             color: transparent; background: transparent " >

                        <div align="center">
                            <h:commandButton  
                                value="Entrar"/>
                        </div>
                    </p:panel>
                </p:panel>
            </div>
        </form>

        <div align="center">
            <p:link id="linkCriarConta"
                    outcome="/publico/login/cadastroUsuario.xhtml">
                Criar uma conta
            </p:link>
        </div>

        <br/>
        <div align="center">
            <html>
                <body>
                    <div id="fb-root"></div>
                    <script>
                        // Load the SDK Asynchronously
                        (function(d) {
                            var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
                            if (d.getElementById(id)) {
                                return;
                            }
                            js = d.createElement('script');
                            js.id = id;
                            js.async = true;
                            js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
                            ref.parentNode.insertBefore(js, ref);
                        }(document));
                    </script>
                    <div class="fb-like"></div>

                </body>
            </html>
        </div>

    </ui:define>

</ui:composition>
